﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace JNTApp.Model
{
    [DataContract]
    class Order : PropertyChangedBase, IStyleSelector
    {

        private int? _idx;
        private int? _icid; //客户编号
        private int? _isid; // 未知，如果是空运则为30，常为0
        private string _caccount;//客户帐号
        private string _cgoods;//物品名称
        private int? _ifid;//
        private string _cnum;//内单号
        private string _cserviceno; //转单号
        private string _cunitname;//收件人单位
        private DateTime? _dsysdate;//录单日期
        private byte? _nstate;//状态
        private byte? _npayway;
        private DateTime? _ddate;  //业务日期
        private string _cdes; //目的地国家
        private decimal? _fweight;//重量
        private decimal? _fweights;//出重
        private decimal? _fsprice;
        private decimal? _fcost; //付下家  花费
        private string _cemskind;//渠道
        private DateTime? _dsenddate;
        private string _cmname;//经办人
        private int? _irid;//已处理订单编号  唯一主键
        private string _cex1;//备注 目前用做转单号存储 转下家CDEK和PONY
        private string _cremail;//收件人邮箱
        private string _cpostcode;//收件人邮编
        private string _creceiver; //收件人姓名
        private string _cphone;//收件人电话
        private string _crsms; //收件人手机
        private string _ccountry;//收件人国家
        private string _cprovince;//收件人省州
        private string _caddr; //收件人详细地址
        private string _cspostcode;//发件人人邮编
        private string _csender; //发件人姓名
        private string _ctransnote;//托运备注
        private int? _iquantity;//物品数量
        private string _clastmod;//最后修改人
        private DateTime? _dlastmod;//最后修改时间
        private string _cmemo;//备注
        private int? _iprice;//物品单价
        private string _csemail; //发件人邮箱
        private string _csaddr; //发件人地址
        private string _csphone;//发件人电话
        private string _cscountry;//发件人国家
        private string _csprovince;//发件人省州
        private string _cscity;//发件人城市
        private string _cex2;//扩展字段 目前用做转下家成功标识 如cdek_success
        private string _ccity;//收件人城市
        private string _cspname; //常为空，‘空运’‘京广快递’
        private byte? _nitemtype;         //快件类型，默认为1。取值为;//0(文件),1(包裹),2(防水袋)
        private byte? _nlanguage;         //地域语言，默认为0。取值为;//0(中国大陆),1(华语),2(其它地域)
        private decimal? _fmount;   //标价 标准价格
        private string _bpay; //
        private string _cemskindc;       //快递类别(客户要求),1-15字符。
        private string _cemskindw;       //快递类别(客户希望),1-15字符。

        private string _check;
        private string _send;

        private Style _style;

        public int? Idx
        {
            get
            {
                return _idx;
            }

            set
            {
                _idx = value;
                this.NotifyPropertyChanged(p => p.Idx);
            }
        }

        [DataMember(Name = "icid")]
        public int? Icid
        {
            get
            {
                return _icid;
            }

            set
            {
                _icid = value;
                this.NotifyPropertyChanged(p => p.Icid);
            }
        }

        [DataMember(Name = "isid")]
        public int? Isid
        {
            get
            {
                return _isid;
            }

            set
            {
                _isid = value;
                this.NotifyPropertyChanged(p => p.Isid);
            }
        }

        [DataMember(Name = "caccount")]
        public string Caccount
        {
            get
            {
                return _caccount;
            }

            set
            {
                _caccount = value;
                this.NotifyPropertyChanged(p => p.Caccount);
            }
        }

        [DataMember(Name = "cgoods")]
        public string Cgoods
        {
            get
            {
                return _cgoods;
            }

            set
            {
                _cgoods = value;
                this.NotifyPropertyChanged(p => p.Cgoods);
            }
        }

        [DataMember(Name = "ifid")]
        public int? Ifid
        {
            get
            {
                return _ifid;
            }

            set
            {
                _ifid = value;
                this.NotifyPropertyChanged(p => p.Ifid);
            }
        }

        [DataMember(Name = "cnum")]
        public string Cnum
        {
            get
            {
                return _cnum;
            }

            set
            {
                _cnum = value;
                this.NotifyPropertyChanged(p => p.Cnum);
            }
        }

        [DataMember(Name = "cserviceno")]
        public string Cserviceno
        {
            get
            {
                return _cserviceno;
            }

            set
            {
                _cserviceno = value;
                this.NotifyPropertyChanged(p => p.Cserviceno);
            }
        }

        [DataMember(Name = "cunitname")]
        public string Cunitname
        {
            get
            {
                return _cunitname;
            }

            set
            {
                _cunitname = value;
                this.NotifyPropertyChanged(p => p.Cunitname);
            }
        }

        [DataMember(Name = "dsysdate")]
        public DateTime? Dsysdate
        {
            get
            {
                return _dsysdate;
            }

            set
            {
                _dsysdate = value;
                this.NotifyPropertyChanged(p => p.Dsysdate);
            }
        }

        [DataMember(Name = "nstate")]
        public byte? Nstate
        {
            get
            {
                return _nstate;
            }

            set
            {
                _nstate = value;
                this.NotifyPropertyChanged(p => p.Nstate);
            }
        }

        [DataMember(Name = "npayway")]
        public byte? Npayway
        {
            get
            {
                return _npayway;
            }

            set
            {
                _npayway = value;
                this.NotifyPropertyChanged(p => p.Npayway);
            }
        }

        [DataMember(Name = "ddate")]
        public DateTime? Ddate
        {
            get
            {
                return _ddate;
            }

            set
            {
                _ddate = value;
                this.NotifyPropertyChanged(p => p.Ddate);
            }
        }

        [DataMember(Name = "cdes")]
        public string Cdes
        {
            get
            {
                return _cdes;
            }

            set
            {
                _cdes = value;
                this.NotifyPropertyChanged(p => p.Cdes);
            }
        }

        [DataMember(Name = "fweight")]
        public decimal? Fweight
        {
            get
            {
                return _fweight;
            }

            set
            {
                _fweight = value;
                this.NotifyPropertyChanged(p => p.Fweight);
            }
        }

        [DataMember(Name = "fweights")]
        public decimal? Fweights
        {
            get
            {
                return _fweights;
            }

            set
            {
                _fweights = value;
                this.NotifyPropertyChanged(p => p.Fweights);
            }
        }

        [DataMember(Name = "fsprice")]
        public decimal? Fsprice
        {
            get
            {
                return _fsprice;
            }

            set
            {
                _fsprice = value;
                this.NotifyPropertyChanged(p => p.Fsprice);
            }
        }

        [DataMember(Name = "fcost")]
        public decimal? Fcost
        {
            get
            {
                return _fcost;
            }

            set
            {
                _fcost = value;
                this.NotifyPropertyChanged(p => p.Fcost);
            }
        }

        [DataMember(Name = "cemskind")]
        public string Cemskind
        {
            get
            {
                return _cemskind;
            }

            set
            {
                _cemskind = value;
                this.NotifyPropertyChanged(p => p.Cemskind);
            }
        }

        [DataMember(Name = "dsenddate")]
        public DateTime? Dsenddate
        {
            get
            {
                return _dsenddate;
            }

            set
            {
                _dsenddate = value;
                this.NotifyPropertyChanged(p => p.Dsenddate);
            }
        }

        [DataMember(Name = "cmname")]
        public string Cmname
        {
            get
            {
                return _cmname;
            }

            set
            {
                _cmname = value;
                this.NotifyPropertyChanged(p => p.Cmname);
            }
        }

        [DataMember(Name = "irid")]
        public int? Irid
        {
            get
            {
                return _irid;
            }

            set
            {
                _irid = value;
                this.NotifyPropertyChanged(p => p.Irid);
            }
        }

        [DataMember(Name = "cex1")]
        public string Cex1
        {
            get
            {
                return _cex1;
            }

            set
            {
                _cex1 = value;
                this.NotifyPropertyChanged(p => p.Cex1);
            }
        }

        [DataMember(Name = "cpostcode")]
        public string Cpostcode
        {
            get
            {
                return _cpostcode;
            }

            set
            {
                _cpostcode = value;
                this.NotifyPropertyChanged(p => p.Cpostcode);
            }
        }

        [DataMember(Name = "creceiver")]
        public string Creceiver
        {
            get
            {
                return _creceiver;
            }

            set
            {
                _creceiver = value;
                this.NotifyPropertyChanged(p => p.Creceiver);
            }
        }

        [DataMember(Name = "cphone")]
        public string Cphone
        {
            get
            {
                return _cphone;
            }

            set
            {
                _cphone = value;
                this.NotifyPropertyChanged(p => p.Cphone);
            }
        }

        [DataMember(Name = "crsms")]
        public string Crsms
        {
            get
            {
                return _crsms;
            }

            set
            {
                _crsms = value;
                this.NotifyPropertyChanged(p => p.Crsms);
            }
        }

        [DataMember(Name = "ccountry")]
        public string Ccountry
        {
            get
            {
                return _ccountry;
            }

            set
            {
                _ccountry = value;
                this.NotifyPropertyChanged(p => p.Ccountry);
            }
        }

        [DataMember(Name = "cprovince")]
        public string Cprovince
        {
            get
            {
                return _cprovince;
            }

            set
            {
                _cprovince = value;
                this.NotifyPropertyChanged(p => p.Cprovince);
            }
        }

        [DataMember(Name = "caddr")]
        public string Caddr
        {
            get
            {
                return _caddr;
            }

            set
            {
                _caddr = value;
                this.NotifyPropertyChanged(p => p.Caddr);
            }
        }

        [DataMember(Name = "cspostcode")]
        public string Cspostcode
        {
            get
            {
                return _cspostcode;
            }

            set
            {
                _cspostcode = value;
                this.NotifyPropertyChanged(p => p.Cspostcode);
            }
        }

        [DataMember(Name = "csender")]
        public string Csender
        {
            get
            {
                return _csender;
            }

            set
            {
                _csender = value;
                this.NotifyPropertyChanged(p => p.Csender);
            }
        }

        [DataMember(Name = "ctransnote")]
        public string Ctransnote
        {
            get
            {
                return _ctransnote;
            }

            set
            {
                _ctransnote = value;
                this.NotifyPropertyChanged(p => p.Ctransnote);
            }
        }

        [DataMember(Name = "iquantity")]
        public int? Iquantity
        {
            get
            {
                return _iquantity;
            }

            set
            {
                _iquantity = value;
                this.NotifyPropertyChanged(p => p.Iquantity);
            }
        }

        [DataMember(Name = "clastmod")]
        public string Clastmod
        {
            get
            {
                return _clastmod;
            }

            set
            {
                _clastmod = value;
                this.NotifyPropertyChanged(p => p.Clastmod);
            }
        }

        [DataMember(Name = "dlastmod")]
        public DateTime? Dlastmod
        {
            get
            {
                return _dlastmod;
            }

            set
            {
                _dlastmod = value;
                this.NotifyPropertyChanged(p => p.Dlastmod);
            }
        }

        [DataMember(Name = "cmemo")]
        public string Cmemo
        {
            get
            {
                return _cmemo;
            }

            set
            {
                _cmemo = value;
                this.NotifyPropertyChanged(p => p.Cmemo);
            }
        }

        [DataMember(Name = "iprice")]
        public int? Iprice
        {
            get
            {
                return _iprice;
            }

            set
            {
                _iprice = value;
                this.NotifyPropertyChanged(p => p.Iprice);
            }
        }

        [DataMember(Name = "csaddr")]
        public string Csaddr
        {
            get
            {
                return _csaddr;
            }

            set
            {
                _csaddr = value;
                this.NotifyPropertyChanged(p => p.Csaddr);
            }
        }

        [DataMember(Name = "csphone")]
        public string Csphone
        {
            get
            {
                return _csphone;
            }

            set
            {
                _csphone = value;
                this.NotifyPropertyChanged(p => p.Csphone);
            }
        }

        [DataMember(Name = "cscountry")]
        public string Cscountry
        {
            get
            {
                return _cscountry;
            }

            set
            {
                _cscountry = value;
                this.NotifyPropertyChanged(p => p.Cscountry);
            }
        }

        [DataMember(Name = "csprovince")]
        public string Csprovince
        {
            get
            {
                return _csprovince;
            }

            set
            {
                _csprovince = value;
                this.NotifyPropertyChanged(p => p.Csprovince);
            }
        }

        [DataMember(Name = "cscity")]
        public string Cscity
        {
            get
            {
                return _cscity;
            }

            set
            {
                _cscity = value;
                this.NotifyPropertyChanged(p => p.Cscity);
            }
        }

        [DataMember(Name = "cex2")]
        public string Cex2
        {
            get
            {
                return _cex2;
            }

            set
            {
                _cex2 = value;
                this.NotifyPropertyChanged(p => p.Cex2);
            }
        }

        [DataMember(Name = "ccity")]
        public string Ccity
        {
            get
            {
                return _ccity;
            }

            set
            {
                _ccity = value;
                this.NotifyPropertyChanged(p => p.Ccity);
            }
        }

        [DataMember(Name = "cspname")]
        public string Cspname
        {
            get
            {
                return _cspname;
            }

            set
            {
                _cspname = value;
                this.NotifyPropertyChanged(p => p.Cspname);
            }
        }

        [DataMember(Name = "nitemtype")]
        public byte? Nitemtype
        {
            get
            {
                return _nitemtype;
            }

            set
            {
                _nitemtype = value;
                this.NotifyPropertyChanged(p => p.Nitemtype);
            }
        }

        [DataMember(Name = "nlanguage")]
        public byte? Nlanguage
        {
            get
            {
                return _nlanguage;
            }

            set
            {
                _nlanguage = value;
                this.NotifyPropertyChanged(p => p.Nlanguage);
            }
        }

        [DataMember(Name = "fmount")]
        public decimal? Fmount
        {
            get
            {
                return _fmount;
            }

            set
            {
                _fmount = value;
                this.NotifyPropertyChanged(p => p.Fmount);
            }
        }

        [DataMember(Name = "bpay")]
        public string Bpay
        {
            get
            {
                return _bpay;
            }

            set
            {
                _bpay = value;
                this.NotifyPropertyChanged(p => p.Bpay);
            }
        }

        [DataMember(Name = "cemskindc")]
        public string Cemskindc
        {
            get
            {
                return _cemskindc;
            }

            set
            {
                _cemskindc = value;
                this.NotifyPropertyChanged(p => p.Cemskindc);
            }
        }

        [DataMember(Name = "cemskindw")]
        public string Cemskindw
        {
            get
            {
                return _cemskindw;
            }

            set
            {
                _cemskindw = value;
                this.NotifyPropertyChanged(p => p.Cemskindw);
            }
        }

        [DataMember(Name = "check")]
        public string Check
        {
            get
            {
                return _check;
            }

            set
            {
                _check = value;
                this.NotifyPropertyChanged(p => p.Check);
            }
        }

        [DataMember(Name = "send")]
        public string Send
        {
            get
            {
                return _send;
            }

            set
            {
                _send = value;
                this.NotifyPropertyChanged(p => p.Send);
            }
        }

        [DataMember(Name = "cremail")]
        public string Cremail
        {
            get
            {
                return _cremail;
            }

            set
            {
                _cremail = value;
                this.NotifyPropertyChanged(p => p.Cremail);
            }
        }

        [DataMember(Name = "csemail")]
        public string Csemail
        {
            get
            {
                return _csemail;
            }

            set
            {
                _csemail = value;
                this.NotifyPropertyChanged(p => p.Csemail);
            }
        }

        public Style Style
        {
            set
            {
                _style = value;
            }
        }

        public Style getStyle()
        {
            return _style;
        }




        /*
        caccount": "1717878@qq.com",
		cgoods": "mini home cleaner ( V5S )",
		ifid": "0",
		cnum": "JNTCU0100036518YQ",
		cserviceno": "JNTCU0100036518YQ",
		cunitname": "广州林欢雨",
		dsysdate": "2016-12-12 10:20:23",
		nstate": "0",
		npayway": "0",
		ddate": "2016-12-12 00:00:00",
		cdes": "俄罗斯",
		fweight": "4.338",
		fweights": "4.338",
		fsprice": "232.50",
		fcost": "0.00",
		cemskind": "俄快通",
		dsenddate": "1900-01-01 00:00:00",
		cmname": "赵婷",
		irid": "283138",
		cex1": null,
		ccreceiver": "Efimenko Elena Vladimirovna",
		ccphone": "7-961-5864025",
		ccrsms": "79615864025",
		cccountry": "Russian Federation",
		ccprovince": "Krasnodar Krai",
		ccaddr": "proezd Dalnij 3  flat 289",
		ccspostcode": "511450",
		ccsender": "广州林欢雨",
		cctransnote": "",
		ciquantity": "1",
		cpostcode": "350078"
        */
    }
}
